package pl.edu.agh.pros.proxy.view.key;

import java.util.Collection;

import pl.edu.agh.pros.proxy.logic.wrapper.AppConfigurationWrapper;

import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.ui.Table;

public class AppKeysTable extends Table {

	private static final long serialVersionUID = 1932167402124840400L;
	private BeanItemContainer<AppConfigurationWrapper> beans = new BeanItemContainer<AppConfigurationWrapper>(
			AppConfigurationWrapper.class);

	public AppKeysTable(Collection<AppConfigurationWrapper> configurations) {

		if (configurations != null) {
			beans.addAll(configurations);
		}
		this.setContainerDataSource(beans);
		this.setWidth("60em");
		this.setVisibleColumns(new Object[] { "name", "providerAppKey", "clientAppKey", "xmppServer" });
		this.setColumnHeaders(new String[] { "Name", "Provider Key", "Client Key", "XMPP Server" });
		this.setWriteThrough(false);
		this.setSelectable(true);
		this.setImmediate(true);
	}

}
